export const config = {
  // JWT配置
  jwtSecret: process.env.JWT_SECRET || 'your-secret-key',
  jwtExpiresIn: process.env.JWT_EXPIRES_IN || '24h',
  
  // 数据库配置
  mongoUri: process.env.MONGO_URI || 'mongodb://localhost:27017/iot',
  
  // MQTT配置
  mqttBroker: process.env.MQTT_BROKER || 'mqtt-broker',
  mqttPort: process.env.MQTT_PORT ? parseInt(process.env.MQTT_PORT) : 1883,
  mqttUsername: process.env.MQTT_USERNAME || 'iot_user',
  mqttPassword: process.env.MQTT_PASSWORD || 'iot_password',
  mqttReconnectPeriod: process.env.MQTT_RECONNECT_PERIOD ? parseInt(process.env.MQTT_RECONNECT_PERIOD) : 10000,
  mqttConnectTimeout: process.env.MQTT_CONNECT_TIMEOUT ? parseInt(process.env.MQTT_CONNECT_TIMEOUT) : 30000,
  
  // 服务器配置
  port: process.env.PORT ? parseInt(process.env.PORT) : 3001,
  websocketPort: process.env.WEBSOCKET_PORT ? parseInt(process.env.WEBSOCKET_PORT) : 8080,
  host: process.env.HOST || 'localhost',
  
  // 邮件服务配置
  smtp: {
    host: process.env.SMTP_HOST || 'smtp.example.com',
    port: process.env.SMTP_PORT ? parseInt(process.env.SMTP_PORT) : 587,
    secure: process.env.SMTP_SECURE === 'true',
    auth: {
      user: process.env.SMTP_USER || 'your_email@example.com',
      pass: process.env.SMTP_PASS || 'your_email_password'
    },
    from: process.env.SMTP_FROM || 'noreply@example.com'
  },
  
  // 管理员配置
  adminRegistrationCode: process.env.ADMIN_REGISTRATION_CODE || 'admin123456'
}; 